/*
 * Package il.ac.biu.cs.grossmm.impl.activeData
 * File MemNode.java
 * 
 * This is a part of presence service framework prototype. 
 * See javadoc for more information.
 *  
 * Copyright (C) 2006 Grossmann Mark
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.

 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 */

package il.ac.biu.cs.grossmm.impl.activeData;

import il.ac.biu.cs.grossmm.api.OperationFailedException;
import il.ac.biu.cs.grossmm.api.data.Node;
import il.ac.biu.cs.grossmm.api.data.Nodeset;
import il.ac.biu.cs.grossmm.api.data.Property;
import il.ac.biu.cs.grossmm.api.data.UpdateType;

import java.util.Set;

public interface MemNode<N> extends Node<N> {

	<V> V getValue(Property<N, V> property, int epoch);

	<V> V getValue(int index, int epoch);

	<S> Set<Node<S>> getSubnodes(Nodeset<N, S> nodeSet, UpdateType u, int stage);

	<S> Set<Node<S>> getSubnodes(int index, int stage);

	<N, S, U> MemNode<S> getSubnode(int nIndex, int uIndex, U value, int epoch);

	<S> Node<S> createSubnode(Nodeset<N, S> nodeSet);

	UpdateType getUpdateType(int epoch);

	void shift();

	void remove();

	<V> void setValue(Property<N, V> property, V value)
			throws OperationFailedException;

	<V> boolean hasValue(Property<N, V> property, V value);
}